package com.soulkun.smarthome.logic.service

import com.soulkun.smarthome.logic.dto.*
import com.soulkun.smarthome.logic.model.AttributeModel
import com.soulkun.smarthome.logic.model.DeviceModel
import com.soulkun.smarthome.logic.model.ResponseModel
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.Headers
import retrofit2.http.POST

interface ApiDeviceService {

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/device/add")
    fun addDevice(@Body requestBody: DeviceModel): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/device/delete")
    fun deleteDevice(@Body requestBody: DeviceModel): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/device/name/modify")
    fun modifyDeviceName(@Body requestBody: DeviceModel): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false")
    @POST("/device/data/get")
    fun getDeviceData(@Body requestBody: DeviceModel): Call<ResponseModel<List<DeviceDataDTO>>>

    @Headers("Ignore-Token: false")
    @POST("/device/list/attribute")
    fun getDeviceAttributeList(@Body requestBody: DeviceModel): Call<ResponseModel<List<AttributeModel>>>

    @Headers("Ignore-Token: false")
    @POST("/device/list/command")
    fun getDeviceCommandList(@Body requestBody: DeviceModel): Call<ResponseModel<List<CommandDTO>>>

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/device/command/post")
    fun postDeviceCommand(@Body requestBody: DeviceCommandPostDTO): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false")
    @POST("/device/history/data")
    fun getDeviceDataHistory(@Body requestBody: DeviceDataHistoryRequestDTO): Call<ResponseModel<DeviceDataHistoryDTO>>

    @Headers("Ignore-Token: false")
    @POST("/device/history/command")
    fun getDeviceCommandHistory(@Body requestBody: DeviceCommandHistoryRequestDTO): Call<ResponseModel<DeviceCommandHistoryDTO>>

}